﻿using Common.Models;
using Wallpaper.Models.DTOs.Requests.Role;
using Wallpaper.Models.DTOs.Responses.Role;
using Wallpaper.Models.Options;

namespace Wallpaper.Services.IService
{
    public interface IRoleService
    {


        /// <summary>
        /// 根据id删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<bool> DeleteAsync(string id);


        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> CreateAsync(CreateRoleRequest request);

        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="id"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(string id,CreateRoleRequest request);


        /// <summary>
        /// 绑定角色
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="adminIds"></param>
        /// <returns></returns>
        Task<bool> BindRoleAsync(string roleId, IEnumerable<string> adminIds);

        /// <summary>
        /// 获取角色信息
        /// </summary>
        /// <returns></returns>
        Task<List<RoleOptionResponse>> GetRoleOptionsAsync();


        /// <summary>
        /// 根据角色id查询绑定用户
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<List<OptionsResponse>>  GetBindInfoAsync(string roleId);

        /// <summary>
        /// 角色分页
        /// </summary>
        /// <param name="queryRequest"></param>
        /// <returns></returns>
        Task<PagedResult<RolePageResponse>> PageAsync(RoleQueryRequest queryRequest);


        /// <summary>
        /// 绑定菜单
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="menuIds"></param>
        /// <returns></returns>
        Task<bool> BindMenuAsync(string id, List<string> menuIds);


        /// <summary>
        /// 获取角色已绑定的菜单
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<List<OptionsResponse>> GetRoleBindMenuAsync(string roleId);

        /// <summary>
        /// 角色绑定权限
        /// </summary>
        /// <param name="id"></param>
        /// <param name="permissions"></param>
        /// <returns></returns>
        Task<bool> BindPermissionAsync(string id, List<string> permissionIds);

        /// <summary>
        /// 获取角色已绑定的权限
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<List<string>> GetRolePermissionsAsync(string roleId);
    }
}
